
from fastapi import APIRouter, Request, status

from dao.user_login import UserLogin

user = APIRouter()

# 用户注册接口
@user.post("/user/register", summary="用户注册", status_code=status.HTTP_201_CREATED)
def user_register(user_form: dict):
    user_dao = UserLogin()
    user_data = user_dao.user_register(user_form)
    return user_data


# 用户登录接口
@user.post("/user/login", summary="用户登录", status_code=status.HTTP_200_OK)
def user_login(user_form: dict):
    user_dao = UserLogin()
    user_data = user_dao.user_login(user_form)
    return user_data